var express = require('express')
var router = express.Router()

// 导入db，操作数据库
const { getAll, getById, exec } = require('../db')

/**
 * 获取各个分类下的文章数量
 */
router.get('/', async (req, res) => {
  let sql = `SELECT article_title , article_views , count from bk_articles
  `
  const data = await getAll(sql)
  res.send({
    code: 0,
    message: '获取各个分类下的文章数量',
    result: data,
  })
})

module.exports = router
